perm filename IMPHDR.TXT[SS,SYS] blob sn#804877 filedate 1986-01-20 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00004 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002		      Format of an IMP message header (32 bit words)
C00007 00003		      Format of an IMP message header (36 bit words)
C00011 00004	TCP state diagram (from RFC 793):
C00017 ENDMK
CāŠ—;
	      Format of an IMP message header (32 bit words)

    (In 1822, IMP-host header bits are numbered 1-96.  Here they are
     numbered starting at 0 in word 0.)

     0			 1		     2			 3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-------+-------+---------------+-------+-+-----+---------------+
0   |unused | New   |  Destination  |unused |T|Ldr  |  Message	    |
    |	    | Format|  Network	    |	    |r|Flags|  Type	    |
    +-------+-------+---------------+-------+-+-----+---------------+
1   |  Handling     |  Destination  |	  Destination		    |
    |  Type	    |  Host	    |	  IMP			    |
    +---------------+-------+-------+-------------------------------+
2   |  Message ID	    |Sub-   |	  Message Length	    |
    |			    |Type   |				    |
    +-----------------------+-------+-------------------------------+


Internet (IP) header  (IHL = Internet header length, in 32-bit words)

     0			 1		     2			 3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-------+-------+---------------+-------------------------------+
3   |Version|  IHL  |Type of Service|	       Total Length	    |
    +-------+-------+---------------+-----+-------------------------+
4   |	      Identification	    |Flags|	 Fragment Offset    |
    +---------------+---------------+-----+-------------------------+
5   |  Time to Live |	 Protocol   |	      Header Checksum	    |
    +---------------+---------------+-------------------------------+
6   |			    Source Address			    |
    +---------------------------------------------------------------+
7   |			 Destination Address			    |
    +-----------------------------------------------+---------------+
    |			 Options		    |	 Padding    |
    +-----------------------------------------------+---------------+


TCP header

     0			 1		     2			 3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-------------------------------+-------------------------------+
8   |	       Source Port	    |	    Destination Port	    |
    +-------------------------------+-------------------------------+
9   |			     Sequence Number			    |
    +---------------------------------------------------------------+
10  |			 Acknowledgement Number			    |
    +-------+-----------+-+-+-+-+-+-+-------------------------------+
    |  Data |		|U|A|P|R|S|F|				    |
11  | Offset| Reserved	|R|C|S|S|Y|I|		 Window		    |
    |	    |		|G|K|H|T|N|N|				    |
    +-------+-----------+-+-+-+-+-+-+-------------------------------+
12  |		Checksum	    |	       Urgent Pointer	    |
    +-------------------------------+---------------+---------------+
    |			 Options		    |	  Padding   |
    +-----------------------------------------------+---------------+
13  |				  data				    |
    +---------------------------------------------------------------+


(IP and TCP options are optional.  Padding fills to 32-bit boundary.)

	      Format of an IMP message header (36 bit words)
			  (assuming no options)

     0			 1		     2			 3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
    +-------+-------+---------------+-------+-+-----+---------------+-------+
0   |unused | New   |  Destination  |unused |T|Ldr  |  Message	    |Handling
    |	    | Format|  Network	    |	    |r|Flags|  Type	    |Type
    +-------+-------+-------+-------+-------+-+-----+-------+-------+-------+
1   Handling|  Destination  |	  Destination		    |  Message ID
     Type   |  Host	    |	  IMP			    |
    +-------+-------+-------+-----------------------+-------+-------+-------+
2    Message|Sub-   |	  Message Length	    |IP     |  IHL  |Type of
     ID     |Type   |				    |Version|	    |Service
    +-------+-------+-----------------------+-------+-------+-------+-------+
3    Type of|	       Total Length	    |	      Identification	    |
     Service|				    |				    |
    +-----+-+-----------------------+-------+-------+---------------+-------+
4   |Flags|	 Fragment Offset    |  Time to Live |	 Protocol   |Cksum
    +-----+-----------------+-------+---------------+---------------+-------+
5      IP Header Checksum   |	       Source Address
    +---------------+-------+-----------------------------------------------+
6    Source Address |		Destination Address
    +-------+-------+-----------------------+-------------------------------+
7   Dest Adr|	       Source Port	    |	    Destination Port	    |
    +-------+-------------------------------+-----------------------+-------+
8   |			     Sequence Number			    |ACK No.
    +-------------------------------------------------------+-------+-------+
9		 Acknowledgement Number			    |  Data | Reser-
							    | Offset| ved
    +---+-+-+-+-+-+-+-------------------------------+-------+-------+-------+
	|U|A|P|R|S|F|				    |
10  Rsvd|R|C|S|S|Y|I|		 Window		    |  TCP checksum
	|G|K|H|T|N|N|				    |
    +---+-+-+-+-+-+-+-----------------------+-------+-----------------------+
11    Cksum |	       Urgent Pointer	    |	   (beginning of data)
    +-------+-------------------------------+-------------------------------+
TCP state diagram (from RFC 793):

September 1981                                                          
                                           Transmission Control Protocol
                                                Functional Specification



                                    
                              +---------+ ---------\      active OPEN  
                              |  CLOSED |            \    -----------  
                              +---------+<---------\   \   create TCB  
                                |     ↑              \   \  snd SYN    
                   passive OPEN |     |   CLOSE        \   \           
                   ------------ |     | ----------       \   \         
                    create TCB  |     | delete TCB         \   \       
                                V     |                      \   \     
                              +---------+            CLOSE    |    \   
                              |  LISTEN |          ---------- |     |  
                              +---------+          delete TCB |     |  
                   rcv SYN      |     |     SEND              |     |  
                  -----------   |     |    -------            |     V  
 +---------+      snd SYN,ACK  /       \   snd SYN          +---------+
 |         |<-----------------           ------------------>|         |
 |   SYN   |                    rcv SYN                     |   SYN   |
 |   RCVD  |<-----------------------------------------------|   SENT  |
 |         |                    snd ACK                     |         |
 |         |------------------           -------------------|         |
 +---------+   rcv ACK of SYN  \       /  rcv SYN,ACK       +---------+
   |           --------------   |     |   -----------                  
   |                  x         |     |     snd ACK                    
   |                            V     V                                
   |  CLOSE                   +---------+                              
   | -------                  |  ESTAB  |                              
   | snd FIN                  +---------+                              
   |                   CLOSE    |     |    rcv FIN                     
   V                  -------   |     |    -------                     
 +---------+          snd FIN  /       \   snd ACK          +---------+
 |  FIN    |<-----------------           ------------------>|  CLOSE  |
 | WAIT-1  |------------------                              |   WAIT  |
 +---------+          rcv FIN  \                            +---------+
   | rcv ACK of FIN   -------   |                            CLOSE  |  
   | --------------   snd ACK   |                           ------- |  
   V        x                   V                           snd FIN V  
 +---------+                  +---------+                   +---------+
 |FINWAIT-2|                  | CLOSING |                   | LAST-ACK|
 +---------+                  +---------+                   +---------+
   |                rcv ACK of FIN |                 rcv ACK of FIN |  
   |  rcv FIN       -------------- |    Timeout=2MSL -------------- |  
   |  -------              x       V    ------------        x       V  
    \ snd ACK                 +---------+delete TCB         +---------+
     ------------------------>|TIME WAIT|------------------>| CLOSED  |
                              +---------+                   +---------+

                      TCP Connection State Diagram
                               Figure 6.


                                                               [Page 23]